package com.yanqu.road.server.gameplayer.module.manor.fishPondTaskCondition;

import com.yanqu.road.entity.manor.FishPondTaskData;
import com.yanqu.road.entity.task.TaskConditionInfo;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.config.TaskMgr;

import java.math.BigInteger;

/**
 * @author ：zfr
 * @date ：2021/10/19 2:07
 */
public class FishingQualityFishCountCondition extends BaseFishPondCondition {

    public FishingQualityFishCountCondition(GamePlayer player, FishPondTaskData fishPondTaskData, Object initArgs, int eventType) {
        super(player, fishPondTaskData, initArgs, eventType);
    }

    @Override
    protected void changeValue(Object object) {
        TaskConditionInfo taskConditionInfo = TaskMgr.getTaskConditionById(getFishPondTaskData().getTaskId());
        int quality = (int) object;
        //品质
        if (BigInteger.valueOf(quality).compareTo(taskConditionInfo.getParamList().get(2)) == 0) {
            setValue(getValue().add(BigInteger.ONE));
        }
    }
}
